//
//  BLStatus.m
//  新浪微博
//
//  Created by hbl on 16/2/22.
//  Copyright © 2016年 hbl. All rights reserved.
//

#import "BLStatus.h"
#import "BLUser.h"
@implementation BLStatus
- (NSString *)created_at
{
    NSDateFormatter *formatter = [[NSDateFormatter alloc]init];
    formatter.dateFormat = @"EEE MMM dd HH:mm:ss Z yyyy";
    formatter.locale = [[NSLocale alloc]initWithLocaleIdentifier:@"en_US"];
    NSDate *date = [formatter dateFromString:_created_at];
    
    NSDateFormatter *myFormatter = [[NSDateFormatter alloc]init];
    myFormatter.dateFormat = @"MMM月dd日 HH:mm";
    NSString *result = [myFormatter stringFromDate:date];
    return result;
}

- (NSString *)source
{
    NSString *temp = nil;
    NSInteger begin = [_source rangeOfString:@">"].location + 1;
    NSInteger length = [_source rangeOfString:@"</"].location - begin;
    if(length >1){
   temp = [_source substringWithRange:NSMakeRange(begin, length)];
    }
    if (!temp) {
        return [NSString stringWithFormat:@""];
    }
    return [NSString stringWithFormat:@"来自%@",temp];

}
@end
